TK!2
=v
#1
:n

:s
b
:c
>>> Derivatives of a polynomial <<<
#2
:n
pc
:v
'abc
:s
i
:c
list with polynomial coefficients
#3
:n
x
:v
1.822875655532296
:s
o
:c
independent variable
:a
x
#4
:n
y
:v
-19.33300524425838
:s
o
:c
f(x), polynomial function
:a
y
#5
:n
dyx1
:v
-26.52025917745214
:s
o
:c
dy/dx, first derivative
:a
dyx1
#6
:n
dyx2
:v
0
:s
i
:c
d2y/dx2, second derivative
:a
dyx2
#7
:n
dyx3
:v
31.74901573277511
:s
o
:c
d3y/dx3, third derivative
:a
dyx3
#8
:n
dyx4
:v
24
:s
o
:c
d4y/dx4, fourth derivative
:a
dyx4
=u
=l
#1
:n
abc
:v
1
-2
-9
2
8
E
#2
:n
x
:v
-2.5
-2.25
-2
-1.75
-1.5
-1.25
-1
-.75
-.5
-.25
0
.25
.5
.75
1
1.25
1.5
1.75
2
2.25
2.5
2.75
3
3.25
3.5
3.75
4
4.25
E
#3
:n
y
:v
17.0625
6.34765625
0
-2.96484375
-3.4375
-2.21484375
0
2.59765625
5.0625
6.97265625
8
7.91015625
6.5625
3.91015625
0
-5.02734375
-10.9375
-17.40234375
-24
-30.21484375
-35.4375
-38.96484375
-40
-37.65234375
-30.9375
-18.77734375
0
26.66015625
E
#4
:n
dyx1
:v
-53
-33.4375
-18
-6.3125
2
7.3125
10
10.4375
9
6.0625
2
-2.8125
-8
-13.1875
-18
-22.0625
-25
-26.4375
-26
-23.3125
-18
-9.6875
2
17.4375
37
61.0625
90
124.1875
E
#5
:n
dyx2
:v
87
69.75
54
39.75
27
15.75
6
-2.25
-9
-14.25
-18
-20.25
-21
-20.25
-18
-14.25
-9
-2.25
6
15.75
27
39.75
54
69.75
87
105.75
126
147.75
E
#6
:n
dyx3
:v
-72
-66
-60
-54
-48
-42
-36
-30
-24
-18
-12
-6
0
6
12
18
24
30
36
42
48
54
60
66
72
78
84
90
E
#7
:n
dyx4
:v
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24
24
E
=f
#1
:n
dpoly
:c
First derivative of polynomial function
:t
Procedure
:i
x,c
:o
z
#2
:n
ndpoly
:c
nth derivative of polynomial function
:t
Procedure
:i
x,c,n
:o
z
#1
:n
dpoly
:z
" This procedure calculates the 1st derivative of a polynomial function
" defined by a list of coefficients  c  (in descending order) at point  x .
" The list of coefficients of a polynomial function representing the 
" derivative are stored in a temporary list 'aux.

z:= 0
n:= length(c) - 1
if n<=0 return
call blank('aux)
call listcopy(c,'aux,1,n)
k:= n
for i=1 to n-1
   'aux[i]:= k*'aux[i]
   k:= k-1
next i
z:= poly(x,'aux)
call delete('aux)
/E
E
#2
:n
ndpoly
:z
" This procedure calculates the nth derivative of a polynomial function
" defined by a list of coefficients  c  (in descending order) at point  x .
" The list of coefficients of a polynomial function representing the 
" derivative are stored in a temporary list 'aux.

z:= 0
m:= length(c)
mn:= m - n
if mn<=0 return
call blank('aux)
call listcopy(c,'aux,1,mn)
n1:= n - 1
for i=1 to mn
   k:= m - i
   for j=k-n1 to k-1
      k:= k*j
   next j
   'aux[i]:= k*'aux[i]
next i
z:= poly(x,'aux)
call delete('aux)
/E
E
=r
#1
:r
y = poly(x,pc)           " This model shows the use of the functions 'dpoly'
#2
:r
dyx1 = dpoly(x,pc)       " and 'ndpoly' for evaluating the  1st  and  nth
#3
:r
dyx2 = ndpoly(x,pc,2)    " derivatives of a polynomial function.
#4
:r
dyx3 = ndpoly(x,pc,3)    " Press F7 to see the graphs of the function and the
#5
:r
dyx4 = ndpoly(x,pc,4)    " derivatives, or F8 to see the tabulated results
#6
:r
                         " of list solving for a series of values of x.
:s
C
#7
:r
" The built-in function 'poly' and the library functions 'dpoly' and 'ndpoly'
:s
C
#8
:r
" are not invertible, i.e. the argument x must be known in order to evaluate
:s
C
#9
:r
" the functions.  The above solution was obtained with the Iterative Solver. 
:s
C
=p
#1
:n
Poly
:t
Line chart
:d
EGA
:i
"y  =  x^4 - 2*x^3 - 9*x^2 + 2*x + 8   and  derivatives"
:s
Yes
:z
X-axis
:g
No
:l
None
:h
""
:v
""
:b
-60,100
:x
x
:u
#1
:y
y
:f
1
:p
Lines
:c
"*"
#2
:y
dyx1
:f
1
:p
Lines
:c
"*"
#3
:y
dyx2
:f
1
:p
Lines
:c
"*"
#4
:y
dyx3
:f
1
:p
Lines
:c
"*"
#5
:y
dyx4
:f
1
:p
Lines
:c
"*"
E
=t
#1
:n
Demo
:s
Screen
:v
Vertical
:f
1
:r
"°"
:c
"°"
:t
"y  =  x^4 - 2*x^3 - 9*x^2 + 2*x + 8   and  derivatives"
:u
#1
:l
x
:n
tab2
:w
9
:h
"   x"
#2
:l
y
:n
tab8
:w
14
:h
" y=f(x)"
#3
:l
dyx1
:n
tab4
:w
10
:h
" dy/dx"
#4
:l
dyx2
:n
tab2
:w
8
:h
"d2y/dx2"
#5
:l
dyx3
:n
tab
:w
6
:h
"d3y/dx3"
#6
:l
dyx4
:n
tab
:w
6
:h
"d4y/dx4"
E
=n
#1
:n
tab8
:d
15
:f
8
:^
Either Scientific or Decimal
:e
"."
:m
""
:p
Blank
:j
Right
:s
- Only
:q
0
:x
2
:l
""
:t
""
:v
"0.          "
#2
:n
tab4
:d
15
:f
4
:^
Either Scientific or Decimal
:e
"."
:m
""
:p
Blank
:j
Right
:s
- Only
:q
0
:x
2
:l
""
:t
""
:v
"0.      "
#3
:n
tab2
:d
15
:f
2
:^
Either Scientific or Decimal
:e
"."
:m
""
:p
Blank
:j
Right
:s
- Only
:q
0
:x
2
:l
""
:t
""
:v
"0.    "
#4
:n
tab
:d
15
:f

:^
Either Scientific or Decimal
:e
"."
:m
""
:p
None
:j
Right
:s
- Only
:q
0
:x
2
:l
""
:t
""
:v
"0  "
=g
#1
:c
.000001
:i
10
:v
Yes
:l
60
:f
66
:m
0
:w
80
:b
Yes
:a
Yes
:r
Yes
:h
No
:t
1
:n
Yes
:d
LPT1
%Tv,f,0,5,0,1,0
%Or,f,0,1,0,1,0
